package com.enreka.clientb;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zw on 2017/12/8.
 */
@EnableEurekaClient
@SpringBootApplication
@RestController
@EnableAutoConfiguration
public class ServerClient {

    public static void main(String[] args) {
        SpringApplication.run(ServerClient.class,args);
    }

    @Value("${fileserver.port}")
    private Integer port;

    @Value("${server.port}")
    private Integer localport;

    @RequestMapping("/hi")
    public String hi(@RequestParam String name){
        StringBuffer stringBuffer = new StringBuffer(20);
        stringBuffer.append("hi i am ServerClientBBB "  + "config server port is " + port + " localport is " + localport);
        return stringBuffer.toString();
    }

}